<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sửa laptop</title>

<link href="../style/cssqt.css" rel="stylesheet" type="text/css" />
</head>

<body>
<?php
$idsuahang = $_GET["idsuahang"];
$mahang = $_POST["mahang"];
$tenhang = $_POST["tenhang"];
$diachi = $_POST["diachi"];
$dienthoai = $_POST["dienthoai"];
$email = $_POST["email"];
$lenh = "select * from hanglaptop where Mahanglaptop='$idsuahang'";
$kq = mysql_query($lenh);
$row = mysql_fetch_array($kq);

if(isset($_POST["sua"]))
{
	$lenhsua = "update hanglaptop set Mahanglaptop='$mahang', Tenhanglaptop='$tenhang', Diachi='$diachi',Dienthoai='$dienthoai', Email='$email'  where Mahanglaptop='$idsuahang'";
	
$kqsua = mysql_query($lenhsua);

if($kqsua)
{
	?>
    <script>
	alert('sửa thành công!');
	location.href='indexqt.php?act=hanglaptop.php';
	</script>
   <?php
  
	
}

}

?>
<form id="form1" name="form1" method="post" action="">
  <table width="900" border="1" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td height="30" colspan="2" align="center" class="title_table">Sửa Hãng Laptop</td>
    </tr>
    <tr>
      <td width="334" height="30">Mã hãng laptop</td>
      <td width="560" height="30"><label for="mahang"></label>
      <input type="text" name="mahang" id="mahang" value="<?php  echo $idsuahang;   ?>" readonly="readonly" /></td>
    </tr>
    <tr>
      <td height="30">Tên hãng laptop</td>
      <td height="30"><label for="tenhang"></label>
      <input type="text" name="tenhang" id="tenhang" value="<?php  echo $row["Tenhanglaptop"];   ?>" /></td>
    </tr>
    <tr>
      <td height="30">Địa chỉ</td>
      <td height="30"><label for="diachi"></label>
      <input type="text" name="diachi" id="diachi" value="<?php  echo $row["Diachi"];   ?>" /></td>
    </tr>
    <tr>
      <td height="30">Điện thoại</td>
      <td height="30"><label for="dienthoai"></label>
      <input type="text" name="dienthoai" id="dienthoai" value="<?php  echo $row["Dienthoai"];   ?>" /></td>
    </tr>
    
    <tr>
      <td height="30">Email</td>
      <td height="30"><label for="email"></label>
      <input type="text" name="email" id="email" value="<?php  echo $row["Email"];   ?>" /></td>
    </tr>
    <tr>
      <td height="30" colspan="2" align="center"><input type="submit" name="sua" id="sua" value="Sửa" /></td>
    </tr>
  </table>
</form>
</body>
</html>